﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CompareTwoCharArrays
{
    class CompareTwoCharArrays
    {
        static void Main(string[] args)
        {
            char[] arrayA = { 'z', 'q', 'r', 'u' };
            char[] arrayB = { 'z', 'q', 'r', 'y' };
            bool areEqual = true;
            if (arrayA.Length != arrayB.Length)
            {
                areEqual = false;
                Console.WriteLine("Are Equal Lexicographically:" + areEqual);
            }
            else
            {
                for (int i = 0; i < arrayA.Length; i++)
                {
                    if (arrayA[i] == arrayB[i])
                    {
                        areEqual = true;
                        Console.WriteLine(arrayA[i] + "=" + arrayB[i]);
                    }
                    else
                    {
                        areEqual = false;
                        Console.WriteLine(arrayA[i] + "!=" + arrayB[i]);
                        break;
                    }
                }
            }
        }
    }
}
